"""
@description: Play audio files.
@author: Zzay
@create: 2022/07/05
"""
import pygame


def play_audio(audio_name):
    """
    Play an audio file.
    :param audio_name: Filename of the audio file
    :return: Play the audio
    """
    try:
        # use mpg321 player
        # call("mpg321 " + audio_name, shell=True)
        pygame.mixer.init()
        pygame.mixer.music.load(audio_name)
        pygame.mixer.music.play()
    except KeyboardInterrupt as e:
        print(e)
    finally:
        pass


if __name__ == '__main__':
    pass
